function PlotLatLong(latitude,longitude,latitude_maneuver,longitude_maneuver,tol_lat,tol_long,target_lat,target_long)

Window = figure;
%[]Opens a new window.

Axes = axes('Parent',Window);
%[]Adds an axes to the specified window.

Earth = imread('Earth_even_better.jpg');
%[]Loads the groundtrack image data.

GroundTrack = image(Earth);
%[]Adds a plot to the current axes.

ScreenSize = get(0,'ScreenSize');
%[]Determines the location and dimensions of the current monitor.

set(GroundTrack, ...
    'XData',[-180,180], ...
    'YData',[-90,90]);
%[]Adjusts the properties of the groundtrack image.

set(Window, ...
    'Color','w', ...
    'NumberTitle','Off', ...
    'Name','SATELLITE GROUND TRACK', ...
    'OuterPosition',ScreenSize);
%[]Adjusts the properties of the specified window.


Longitude = {'180W','165W','150W','135W','120W','105W','90W','75W','60W','45W','30W','15W', ...
    '0','15E','30E','45E','60E','75E','90E','105E','120E','135E','150E','165E','180E'};
%[]Longitude string.

Latitude = {'90N','75N','60N','45N','30N','15N','0','15S','30S','45S','60S','75S','90S'};
%[]Latitude string.

set(Axes, ...
    'FontName','Arial', ...
    'FontSize',8, ...
    'FontWeight','Bold', ...
    'NextPlot','Add', ...
    'XColor','k', ...
    'YColor','k', ...
    'XGrid','On', ...
    'YGrid','On', ...
    'XLim',[-180,180], ...
    'YLim',[-90,90], ...
    'XTick',-180:15:180, ...
    'YTick',-90:15:90, ...
    'XTickLabel',Longitude, ...
    'YTickLabel',Latitude);
%[]Adjusts the properties of the specified axis.

plot(longitude,-latitude, ...
    'Color','r', ...
    'LineStyle','None', ...
    'Marker','.', ...
    'MarkerSize',5, ...
    'Parent',Axes);
%[]Plots the satellite ground track.


plot(longitude_maneuver,-latitude_maneuver, ...
    'Color','c', ...
    'LineStyle','None', ...
    'Marker','.', ...
    'MarkerSize',5, ...
    'Parent',Axes);
%[]Plots the satellite ground track.

xlabel('Longitude (\circ)','FontSize',16,'Parent',Axes);
%[]Adds a label to the x-axis.

ylabel('Latitude (\circ)','FontSize',16,'Parent',Axes);
%[]Adds a label to the y-axis.
axis equal
furtherlim = 45;
xlim([target_long-tol_long-furtherlim,target_long+tol_long+furtherlim])
ylim([target_lat-tol_lat-furtherlim,target_lat+tol_lat+furtherlim])

x1=target_long-tol_long;
x2=target_long+tol_long;
y1=target_lat-tol_lat;
y2=target_lat+tol_lat;
x = [x1, x2, x2, x1, x1];
y = [y1, y1, y2, y2, y1];
plot(x, y, 'm-', 'LineWidth', 3);
hold on
x1=target_long-5*tol_long;
x2=target_long+5*tol_long;
y1=target_lat-5*tol_lat;
y2=target_lat+5*tol_lat;
x = [x1, x2, x2, x1, x1];
y = [y1, y1, y2, y2, y1];
plot(x, y, 'c-', 'LineWidth', 3)
end
%===================================================================================================




